<template>
  <div class="ui-shade imglistshade" @click.self="close">
    <swiper :options="swiperOption">
      <swiper-slide v-for="item in imglist" :key="item.id">
        <img :src="item" />
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        swiperOption: {
          pagination: '.swiper-pagination',
          speed: 500
        },
      }
    },
    props:{
      imglist:{
        type:Array,
        required:true
      },
      index:{
        type:Number,
        default:3
      }
    },
    created() {
      this.swiperOption.initialSlide = this.index;
    },
    methods: {
      close(){
        this.$emit("closeMolde",false)
      }
    }
  }
</script>

<style>
  .imglistshade img{
    width: 100%;
    display: block;
  }

  .ui-shade{
    background: rgba(0,0,0,.9);
  }

  .imglistshade .swiper-pagination-bullet-active{
    background: #fff !important;
  }

  .imglistshade .swiper-pagination.swiper-pagination-bullets{
    position: fixed;
    bottom: .5rem;
  }

  .imglistshade .swiper-pagination-bullet{
    width: 4px;
    height: 4px;
  }

  .imglistshade .swiper-slide{
    display: flex;
    align-items: center;
  }

  .imglistshade .swiper-container{
    display: flex;
    align-items: center;
  }

  .imglistshade .swiper-container{
    overflow: visible;
    width: 100%;
    height: 2rem;
  }

</style>
